<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>Nordic Thingy:52 v2.2.0 : Sx150x LED driver register calculation</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet_offline.css" rel="stylesheet" type="text/css"/>
<link href="nordic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" width="100%" class="blank">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Nordic Semiconductor" src="nordic_small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Nordic Thingy:52 v2.2.0
   </div>
  </td>
 </tr>
 </tbody>
</table>
<script>
var url=window.location.href.split("/").reverse()[1];
var validLinks= ["nrf5","s130","s132","s212","s332"];
var index;
for (index = 0; index < validLinks.length; ++index) {
   if ( url.indexOf(validLinks[index]) !== -1 ) {
      document.getElementById(validLinks[index]).setAttribute('class', 'doclinks docselected');
   };
};
</script>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__sx150x__led__drv__calc.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Sx150x LED driver register calculation<div class="ingroups"><a class="el" href="group__util.html">Utilities</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Sx150x LED driver register calculation API.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gab04a0655cd1e3bcac5e8f48c18df1a57"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <br />
&#160;&#160;<a class="el" href="group__sx150x__led__drv__calc.html#ggab04a0655cd1e3bcac5e8f48c18df1a57a0aa0d95c9054e90eef9fbb3722abff6a">SX150x_LED_DRC_CALC_STATUS_CODE_SUCCESS</a>, 
<a class="el" href="group__sx150x__led__drv__calc.html#ggab04a0655cd1e3bcac5e8f48c18df1a57acb840217932f263328ae89456652958e">SX150x_LED_DRV_CALC_STATUS_CODE_INACCURATE</a>, 
<a class="el" href="group__sx150x__led__drv__calc.html#ggab04a0655cd1e3bcac5e8f48c18df1a57a1b97777ad94b5f9a437763a3b311aa7b">SX150x_LED_DRV_CALC_STATUS_CODE_INVALID_PARAM</a>, 
<a class="el" href="group__sx150x__led__drv__calc.html#ggab04a0655cd1e3bcac5e8f48c18df1a57a5f78b0f4b03236abab2f9e4123785c3c">SX150x_LED_DRV_CALC_STATUS_CODE_NULL</a>, 
<br />
&#160;&#160;<a class="el" href="group__sx150x__led__drv__calc.html#ggab04a0655cd1e3bcac5e8f48c18df1a57ad6c5773978cfc8497a7123d516774d25">SX150x_LED_DRV_CALC_STATUS_CODE_NOT_INIT</a>
<br />
 }<tr class="memdesc:gab04a0655cd1e3bcac5e8f48c18df1a57"><td class="mdescLeft">&#160;</td><td class="mdescRight">The SX150x led driver calc status codes.  <a href="group__sx150x__led__drv__calc.html#gab04a0655cd1e3bcac5e8f48c18df1a57">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:gab04a0655cd1e3bcac5e8f48c18df1a57"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa2de58083f0d376cd8c62f89afe69614"><td class="memItemLeft" align="right" valign="top">ret_code_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sx150x__led__drv__calc.html#gaa2de58083f0d376cd8c62f89afe69614">sx150x_led_drv_calc_convert</a> (uint16_t port_mask, drv_ext_light_sequence_t *const real_vals, <a class="el" href="structsx150x__led__drv__regs__vals__t.html">sx150x_led_drv_regs_vals_t</a> *const reg_vals)</td></tr>
<tr class="memdesc:gaa2de58083f0d376cd8c62f89afe69614"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts from real values (intensity (0x00-0xFF and time in milliseconds) to register values.  <a href="#gaa2de58083f0d376cd8c62f89afe69614">More...</a><br /></td></tr>
<tr class="separator:gaa2de58083f0d376cd8c62f89afe69614"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7e3001ab55720cc4c588cc2e23a9e5f9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sx150x__led__drv__calc.html#ga7e3001ab55720cc4c588cc2e23a9e5f9">sx150x_led_drv_calc_fade_supp</a> (uint16_t port_mask)</td></tr>
<tr class="memdesc:ga7e3001ab55720cc4c588cc2e23a9e5f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if all the supplied pins in port_mask supports fade.  <a href="#ga7e3001ab55720cc4c588cc2e23a9e5f9">More...</a><br /></td></tr>
<tr class="separator:ga7e3001ab55720cc4c588cc2e23a9e5f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9907d106ed36ac6bb7a5e01abfd7b225"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sx150x__led__drv__calc.html#ga9907d106ed36ac6bb7a5e01abfd7b225">sx150x_led_drv_calc_init</a> (uint16_t fade_supported_port_mask, uint32_t clkx_tics_pr_sec)</td></tr>
<tr class="memdesc:ga9907d106ed36ac6bb7a5e01abfd7b225"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the SX150x led driver register calculation module.  <a href="#ga9907d106ed36ac6bb7a5e01abfd7b225">More...</a><br /></td></tr>
<tr class="separator:ga9907d106ed36ac6bb7a5e01abfd7b225"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Sx150x LED driver register calculation API. </p>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gab04a0655cd1e3bcac5e8f48c18df1a57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab04a0655cd1e3bcac5e8f48c18df1a57">&#9670;&nbsp;</a></span>anonymous enum</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The SX150x led driver calc status codes. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggab04a0655cd1e3bcac5e8f48c18df1a57a0aa0d95c9054e90eef9fbb3722abff6a"></a>SX150x_LED_DRC_CALC_STATUS_CODE_SUCCESS&#160;</td><td class="fielddoc"><p>Successful. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab04a0655cd1e3bcac5e8f48c18df1a57acb840217932f263328ae89456652958e"></a>SX150x_LED_DRV_CALC_STATUS_CODE_INACCURATE&#160;</td><td class="fielddoc"><p>One or more of the set time parameters deviate by more than 20 %. Accept or try again with different values or osc divider. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab04a0655cd1e3bcac5e8f48c18df1a57a1b97777ad94b5f9a437763a3b311aa7b"></a>SX150x_LED_DRV_CALC_STATUS_CODE_INVALID_PARAM&#160;</td><td class="fielddoc"><p>Invalid parameters. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab04a0655cd1e3bcac5e8f48c18df1a57a5f78b0f4b03236abab2f9e4123785c3c"></a>SX150x_LED_DRV_CALC_STATUS_CODE_NULL&#160;</td><td class="fielddoc"><p>NULL parameter supplied. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab04a0655cd1e3bcac5e8f48c18df1a57ad6c5773978cfc8497a7123d516774d25"></a>SX150x_LED_DRV_CALC_STATUS_CODE_NOT_INIT&#160;</td><td class="fielddoc"><p>The module has not been initalized. Has init been called? </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaa2de58083f0d376cd8c62f89afe69614"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa2de58083f0d376cd8c62f89afe69614">&#9670;&nbsp;</a></span>sx150x_led_drv_calc_convert()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_code_t sx150x_led_drv_calc_convert </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>port_mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">drv_ext_light_sequence_t *const&#160;</td>
          <td class="paramname"><em>real_vals</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structsx150x__led__drv__regs__vals__t.html">sx150x_led_drv_regs_vals_t</a> *const&#160;</td>
          <td class="paramname"><em>reg_vals</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts from real values (intensity (0x00-0xFF and time in milliseconds) to register values. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">port_mask</td><td>16-bit port mask </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">real_vals</td><td>The requested values. Will contain the actual set values after processing </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">reg_vals</td><td>Register values set as close as possible to achieve the requested values</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SX150x_LED_DRC_CALC_STATUS_CODE_SUCCESS </dd>
<dd>
SX150x_LED_DRV_CALC_STATUS_CODE_INACCURATE </dd>
<dd>
SX150x_LED_DRV_CALC_STATUS_CODE_INVALID_PARAM </dd>
<dd>
SX150x_LED_DRV_CALC_STATUS_CODE_NULL </dd>
<dd>
SX150x_LED_DRV_CALC_STATUS_CODE_NOT_INIT </dd></dl>

</div>
</div>
<a id="ga7e3001ab55720cc4c588cc2e23a9e5f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7e3001ab55720cc4c588cc2e23a9e5f9">&#9670;&nbsp;</a></span>sx150x_led_drv_calc_fade_supp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool sx150x_led_drv_calc_fade_supp </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>port_mask</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if all the supplied pins in port_mask supports fade. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">port_mask</td><td>16-bit port mask.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>: If port_mask = 0, false is returned.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>true All the given pins support fade. </dd>
<dd>
false One or more of the supplied pins does not support fade. </dd></dl>

</div>
</div>
<a id="ga9907d106ed36ac6bb7a5e01abfd7b225"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9907d106ed36ac6bb7a5e01abfd7b225">&#9670;&nbsp;</a></span>sx150x_led_drv_calc_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sx150x_led_drv_calc_init </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>fade_supported_port_mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>clkx_tics_pr_sec</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the SX150x led driver register calculation module. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">fade_supported_port_mask</td><td>16-bit port mask holding "1" in positions corresponding to pins which supports fading. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">clkx_tics_pr_sec</td><td>Number of ticks / sec for the internal ioext oscillatior after division. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="topicfooter">
<a href="mailto:docfeedback@nordicsemi.no?subject=Documentation%20feedback" id="maillink">Documentation feedback</a> | <a href="https://devzone.nordicsemi.com/questions/" target="_blank">Developer Zone</a> | <a href="http://response.nordicsemi.com/subscribe-to-our-newsletters" target="_blank">Subscribe</a> | Updated <span id="date"/>
<script>
var date = new Date("Thu Feb 7 2019" + " UTC");
document.getElementById("date").innerHTML = date.toJSON().slice(0, 10);
var url=window.location.href.split("?")[0];
var filename=url.substring(url.lastIndexOf('/')+1);
document.getElementById("maillink").href = "mailto:docfeedback@nordicsemi.no?subject=Documentation%20feedback"+decodeURIComponent("%26")+"body=File%20name%3A%20"+encodeURIComponent(filename);
</script>
</div>
</body>
</html>
